class ApiTpshopLogin:
    def __init__(self, session):
        # 可以在这准备url，也可以在对应的请求方法中定义url，接收session
        # self.session = session
        pass


    # 发送验证码请求
    def get_verification(self, session):
        url = "http://tpshop-test.itheima.net/index.php?m=Home&c=User&a=verify&r=0.21519623710645064"
        resp = session.get(url=url)
        return resp

    # 登录请求
    def login(self, session, login_data):
        url = "http://tpshop-test.itheima.net/index.php?m=Home&c=User&a=do_login&t=0.7094195931397276"
        resp = session.post(url=url, data=login_data)
        return resp

